# -*- coding: utf-8 -*-
import json

from flask.blueprints import Blueprint
from blueprint.olt_service import *
from flask import request
from utils.decorator import json_resp
from blueprint.timeFlag_service import *

bp = Blueprint('modify_bp', __name__, url_prefix='/api')
currentTime = ''


@bp.route('/modifyTime/')
@json_resp
def modifyConstant():
    global currentTime
    note = request.args.get('note', '').encode('utf-8')
    if (note == ''):
        modifyTime = getNew()
    else:
        modifyTime = getTime(note)
    print(modifyTime)
    currentTime = modifyTime
    return dict(success=True, data=modifyTime)
